#include <iostream>

int main() {
    // 布尔类型
    bool isTrue = true;
    std::cout << "布尔类型 bool: " << (isTrue? "true" : "false") << std::endl;

    // 字符类型
    char singleChar = 'a';
    std::cout << "字符类型 char: " << singleChar << std::endl;

    // 有符号字符类型
    signed char signedCharValue = -10;
    std::cout << "有符号字符类型 signed char: " << static_cast<int>(signedCharValue) << std::endl;

    // 无符号字符类型
    unsigned char unsignedCharValue = 200;
    std::cout << "无符号字符类型 unsigned char: " << static_cast<int>(unsignedCharValue) << std::endl;

    // 宽字符类型
    wchar_t wideChar = L'中';
    std::wcout << L"宽字符类型 wchar_t: " << wideChar << std::endl;

    // 短整型
    short shortIntValue = 100;
    std::cout << "短整型 short: " << shortIntValue << std::endl;

    // 无符号短整型
    unsigned short unsignedShortValue = 50000;
    std::cout << "无符号短整型 unsigned short: " << unsignedShortValue << std::endl;

    // 整型
    int intValue = -1000;
    std::cout << "整型 int: " << intValue << std::endl;

    // 无符号整型
    unsigned int unsignedIntValue = 4000000000;
    std::cout << "无符号整型 unsigned int: " << unsignedIntValue << std::endl;

    // 长整型
    long longIntValue = 1000000000000LL;
    std::cout << "长整型 long: " << longIntValue << std::endl;

    // 无符号长整型
    unsigned long unsignedLongValue = 1800000000000ULL;
    std::cout << "无符号长整型 unsigned long: " << unsignedLongValue << std::endl;

    // 常量（const 修饰）
    const int constValue = 5;
    // constValue = 10;  // 这行会报错，因为 const 修饰的变量值不可修改

    // volatile 修饰的变量，这里简单展示声明，实际应用场景较复杂
    volatile int volatileValue = 10;

    // mutable 在类中的使用示例，这里先简单定义一个类
    class MyClass {
    public:
        mutable int counter;
        void increment() const {
            counter++;
        }
    };
    MyClass obj;
    obj.counter = 0;
    obj.increment();
    std::cout << "mutable 修饰的类成员 counter: " << obj.counter << std::endl;

    return 0;
}
